﻿ <?php ;
            include './connection.php';
            $con=mysqli_connect("localhost","root","vertrigo");
            // Check connection
            if (mysqli_connect_errno()) {
              echo "Failed to connect to MySQL: " . mysqli_connect_error();
            }
            
            $name= $_POST['name'];
            $sex= $_POST['sex'];
            $email=  $_POST['email'];
            $address= $_POST['address'];
            $submit=$_POST['submit'];
            //$sql="insert into students(ID, NAME, SEX, EMAIL,ADDRESS) VALUES('','$name','$sex','$email','$address')";
            if(isset($submit))
            {
                $insert=  mysql_query("insert into students(ID, NAME, SEX, EMAIL,ADDRESS) VALUES('','$name','$sex','$email','$address')");
                echo 'Da them thanh cong!';
            }
            
           /* if(!mysqli_query($con, $sql))
            {
                die('Lỗi khi thêm: '.mysqli_error($con));
            }
            echo "Đã thêm thành công 1 sinh viên mới!";

            //đóng csdl*/
            //mysqli_close($con);
        ?>